<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
    <!-- Loading Bootstrap -->
    <link href="Public/Admin/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
    <!-- Loading Flat UI -->
    <link href="Public/Admin/Flat/dist/css/flat-ui.css" rel="stylesheet">
    <link rel="shortcut icon" href="Public/Admin/Flat/img/favicon.ico">
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
    <!--[if lt IE 9]>
    <script src="dist/js/vendor/html5shiv.js"></script>
    <script src="dist/js/vendor/respond.min.js"></script>
    <![endif]-->

    <script type="text/javascript" src="Public/uploadify/jquery-1.8.2.min.js"></script>
    <style type="text/css">
        .caozuo a{
            float: right;
            margin-right: 10px;
        }
    </style>
</head>
<body>
<div class="alert alert-success">节点列表</div>
    <table class="table table-hover"  style="border:1px solid #DDDDDD;">
        <tr class="active">
            <th width="100">节点ID</th>
            <th width="150">节点名称</th>
            <th width="150">节点标题</th>
            <th width="100">状态</th>
            <th width="100">level</th>
            <th width="100">show</th>
            <th>排序</th>
            <th width="250">操作</th>
        </tr>

        <!-- 控制子集显隐 -->
        <script type="text/javascript">
            $(function(){
                $('.open').toggle(function(){
                    var id = $(this).attr('id');
                    $('tr[pid=' + id + ']').fadeIn(600);
                }, function(){
                    var id = $(this).attr('id');
                    $('tr[pid=' + id + ']').fadeOut(600);
                });
            });
        </script>
                
        {{foreach from="$nodeData" key="$k" value="$v"}}
            <tr  pid="{{$v['pid']}}" {{if value="$v['pid']!=0"}} style="display:none;" {{endif}}>
                <td>{{$v['id']}}</td>
                <td  class='open' id="{{$v['id']}}">{{$v['_name']}}</td>
                <td>{{$v['title']}}</td>
                <td>{{$v['status']}}</td>
                <td>{{$v['level']}}</td>
                <td>{{$v['show']}}</td>
                <td>{{$v['sort']}}</td>
                <td class="caozuo">
                    <a href="javascript:if(confirm('确定删除吗？')) location.href='{{U('delnode',array('nid'=>$v['id']))}}';" class="btn btn-sm btn-danger">删除</a>
                    <a href="{{U('editnode',array('nid'=>$v['id']))}}" class="btn btn-sm btn-warning">编辑</a>
                    {{if value="$v['level']==1"}}
                        <a href="{{U('addnode',array('pid'=>$v['id'],'level'=>$v['level']))}}" class="btn btn-sm btn-primary">添加控制器</a>
                    {{elseif value="$v['level']==2"}}
                        <a href="{{U('addnode',array('pid'=>$v['id'],'level'=>$v['level']))}}" class="btn btn-sm btn-primary">添加方法</a>
                    {{else}}

                    {{endif}}
                </td>
            </tr>
        {{endforeach}}
    </table>
<a href="{{U('addnode',array('pid'=>0,'level'=>0))}}" class="btn btn-primary btn-block">添加新模块</a>
</body>
</html>